import React, {Component} from 'react'
import {TopicWarrper,TopicItem} from '../style'
import {connect} from "react-redux";

class Topic extends Component{
    render(){
        const {list} = this.props;
        return(
            <TopicWarrper>
                {list.map((item)=>{
                    return (
                        <TopicItem key={item.get('id')}>
                            <img className='topic-pic' src={item.get('url')} alt=""/>
                            <span>{item.get('title')}</span>
                        </TopicItem>
                    )
                })}

            </TopicWarrper>
       )
    }
}
const mapState=(state)=>({
   list:state.get('home').get('topicList')
});
export default connect(mapState,null)(Topic)